/*
PearReview - The peer review assistant.
Copyright (C) 2009  Dimitrij Pankratz, Anton Musichin
http://www.pearreview.com, info@pearreview.com

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*/

package com.pearreview.application;

import java.io.Serializable;

/**
 * Every Plugin have to implement this interface.
 * The plugin should not have a constructor with parameters, otherwise
 * it can not be loaded.
 * 
 * @author Dimitrij Pankratz, Anton Musichin
 *
 */
public interface Plugin extends Serializable {
	/**
	 * Closes the plugin.
	 * @return if plugin can be closed, it should return <code>true</code>, 
	 * otherwise <code>false</code>
	 */
	public boolean close();
	
	/**
	 * This method will be called, when a plugin should be started.
	 * Use this method to instantiate the component, tool bar and menu bar.
	 * <br><b>NOTE</b>: Do not call navigateToStartTab():PluginAdapter method, 
	 * otherwise the call will be ignored.
	 * @param pa plugin adapter
	 * @param mba menu bar adapter
	 */
	public void run(PluginAdapter pa);
	
	/**
	 * Returns the plugin title
	 */
	public String getTitle();
	
	/**
	 * The plugin load auto save data on run methode
	 * @param file
	 */
	public void loadSaveDataOnRun(SaveData data);
	
	/**
	 * Plugin returns auto save data
	 * @return auto save data of this plugin
	 */
	public SaveData getSaveData();
}
